home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / include / server_def.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-28  |  3.6 KB  |  85 lines

  1.     /*********************************************************************\
  2.     *  Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu)   *
  3.     *                                                                     *
  4.     *  You may copy or modify this file in any manner you wish, provided  *
  5.     *  that this notice is always included, and that you hold the author  *
  6.     *  harmless for any loss or damage resulting from the installation or *
  7.     *  use of this software.                                              *
  8.     \*********************************************************************/
  9.  
  10. #ifndef _FSP_SERVER_DEF_H_
  11. #define _FSP_SERVER_DEF_H_
  12.  
  13. #include "common_def.h"
  14. #include "server_conf.h"
  15.  
  16. #define NBSIZE (2*sizeof(UBUF))
  17.  
  18. /****************************************************************************
  19. *  HTAB is structure for storing client information for one client machine.
  20. *  They makes it easy to reuse regular unix tool's source for new purposes.
  21. ****************************************************************************/
  22.  
  23. typedef struct HTAB HTAB;
  24.  
  25. struct HTAB {    unsigned long    inet_num;    /* inet number of client     */
  26.         char           *hostname;    /* hostname of client        */
  27.         unsigned long   last_acc;    /* last sucessful access time*/
  28.         unsigned short    next_key;    /* next key client should use*/
  29.         unsigned short    last_key;    /* previous key client used  */
  30.         unsigned short   acc_cnt;    /* number of successful acc  */
  31.         unsigned short  active:1; };    /* session continuing.         */
  32.  
  33. /****************************************************************************
  34. *  IPrange is the structure for storing information about disabled, ignored
  35. *  or normal hosts.
  36. ****************************************************************************/
  37. typedef struct {
  38.     unsigned char lo[4];
  39.     unsigned char hi[4];
  40.     char *text;
  41. } IPrange;
  42.  
  43. /*****************************************************************************
  44. * The PPATH structure is filled in by the function check_path when given a
  45. * path string.  See server_file.c for more info.
  46. *****************************************************************************/
  47.  
  48. typedef struct { char *fullp; /* ptr to string containing full pathname  */
  49.          char *f_ptr; /* ptr to begining of last path component  */
  50.          int   f_len; /* length of last component in path        */
  51.          char *d_ptr; /* ptr to beginning of directory component */
  52.          int   d_len; /* length of directory part of path.       */
  53.          char *r_ptr; /* part of path that belongs to remote FSP */
  54.                  char *passwd; /* ptr to password                        */
  55.          char  inetstr[16]; /* inet-address of remote-FSP        */
  56.          char  portstr[8];  /* port of remote-FSP                */
  57.            } PPATH;
  58.  
  59. typedef struct { FILE *fp;
  60.                  char filename[NBSIZE];
  61.                  unsigned long inet_num;
  62.                  unsigned long port_num;
  63.                } FPCACHE;
  64.  
  65. extern int dbug;   /* debug flag */
  66. extern char *home_dir;
  67. extern FPCACHE *cache_p, fpcache[FSP_FILE_CACHE+1];
  68. extern int max_nlen;
  69. extern int always_use_cache_dir;
  70. extern int dir_cache_limit;
  71. extern char *dir_cache_dir;
  72.  
  73. /* THCCOUNT is the number of seconds used to compute average throughput.
  74.  * 10 seconds seems to be a good value
  75.  */
  76. #define THCCOUNT 10
  77.  
  78. #define REVERSE_ERR_MSG "Permission denied -- can't identify host.\n\
  79.   Sorry, we can't reverse name you.  If you know that your site normally\n\
  80.   can be, try again in a few minutes when the local maps may have been\n\
  81.   updated.  Otherwise, this service will remain unavailable to you; check\n\
  82.   with your local admins for why this is the case.\n"
  83.  
  84. #endif /* _FSP_SERVER_DEF_H_ */
  85.